package com.lxg;

import com.lxg.dao.UserDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 陆小根
 * date: 2022/04/23
 * Description:
 */

public class AppFroInstanceUser {

  public static void main(String[] args) {
    // 使用实例工厂获取bean实例
//    UserDaoFactory daoFactory = new UserDaoFactory();
//    UserDao userDao = daoFactory.getUserDao();
//    userDao.save();

    //
    ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
    UserDao userDao1 = (UserDao) context.getBean("userDao");
    UserDao userDao2 = (UserDao) context.getBean("userDao");

    System.out.println(userDao1);
    System.out.println(userDao2);
//    userDao.save();



  }

}
